//
//  SRSystemNetSource.m
//  SportRing
//
//  Created by Apple on 14/10/29.
//  Copyright (c) 2014年 HotOne. All rights reserved.
//

#import "SRSystemNetSource.h"
#import <AFNetworking.h>

@implementation SRSystemNetSource

+ (void)getPosterWithSuccess:(CompletionBlockWithDictionary)success
                     failure:(CompletionBlockWithError)failure
{
    [self getAction:@"v1/Common/Poster"
         parameters:@[]
            success:success
            failure:failure];
}

//吐槽上传
+ (void)careCommonWithToken:(NSString *)token
                     IThink:(NSString *)IThink
                    success:(CompletionBlockWithDictionary)success
                    failure:(CompletionBlockWithError)failure
{
    [self postAction:@"v1/Common/care"
          parameters:@{@"token":token,
                       @"iThink":IThink}
             success:success
             failure:failure];
}

//获取里程碑信息
+ (void)getMilepostWithSuccess:(CompletionBlockWithDictionary)success
                       failure:(CompletionBlockWithError)failure
{
    [self getAction:@"v1/Common/milepost"
          parameters:@[]
             success:success
             failure:failure];
}

+ (void)postUserMilepostWithToken:(NSString *)token
                         success:(CompletionBlockWithDictionary)success
                         failure:(CompletionBlockWithError)failure
{
    [self postAction:@"v1/userinfo/milepost"
          parameters:@{@"token":token}
             success:success
             failure:failure];
}

+ (void)checkVersionUpdateWithSuccess:(CompletionBlockWithDictionary)success
                              failure:(CompletionBlockWithError)failure
{
    AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager];
    [manager GET:@"http://fir.im/api/v2/app/version/5516ec8464f39a9d75001dc2"
      parameters:nil
         success:^(AFHTTPRequestOperation *operation, id responseObject) {
             success(responseObject);
         } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
             failure(error);
         }];
}

@end
